package org.yscz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.yscz.entity.Answer;
import org.yscz.entity.vo.ReportVo;

import java.util.Map;

/**
 * @program: pe
 * @description: 数据层 答题表
 * @author: muqs
 * @create: 2021-08-27 21:30
 **/
public interface AnswerMapper extends BaseMapper<Answer> {

    /**
     * @Description: 计算答题总时长
     * @Param: recordId
     * @return: int
     * @Author: muqs
     * @Date: 2021/8/31
     */
    Integer sumDuration(@Param(value = "recordId") Long recordId);

    /**
     * @Description: 获取报告综述信息
     * @Param: recordId
     * @return: ReportVo
     * @Author: muqs
     * @Date: 2021/8/31
     */
    ReportVo getReportReview(@Param(value = "recordId") Long recordId);

    /**
     * @Description: 根据量表id和测评记录id获取测评分数
     * @Author: Muqs
     * @Param: scaleId
     * @Param: recordId
     * @return: String
     * @Date: 2021/9/2
     */
    String getScore(@Param(value = "recordId") Long recordId);

    /**
     * @Description: 查询当前答题进度
     * @Author: Muqs
     * @Param: scaleId
     * @Param: recordId
     * @Date: 2021/9/2
     */
    Integer selectAnswerProgress(@Param(value = "recordId") Long scaleId);
}
